﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using NF_Mode;
using NF_Tools;
using NF_Base;
using System.Threading.Tasks;
using Newtonsoft.Json;
using System.Collections;
using System.Security.Cryptography;
using NF_Web.Event;
using System.Text.RegularExpressions;
using NF_Mode;

namespace NF_Web
{
    public partial class FrmWork : Form
    {
        public FrmWork()
        {
            InitializeComponent();
            morebtn.Checkit = true;
        }

        private RoomControl CheckedRoom = new RoomControl();        //当前选择的包间
        private string tips = string.Empty;                         //账单包间提示语

        /// <summary>
        /// LODE
        /// </summary>
        private void FrmWork_Load(object sender, EventArgs e)
        {
            

        }


        /// <summary>
        /// 加载工具条 - 加载账单
        /// </summary>
        void rmc_LodeToolsClick(object sender, EventArgs e)
        {
            
        }

        /// <summary>
        /// 加载预订列表
        /// </summary>
        void rmc_FixNumberClick(object sender, EventArgs e)
        {

        }

        /// <summary>
        /// 操作栏事件
        /// </summary>
        void btn_Click(object sender, EventArgs e)
        {
           
        }


        /// <summary>
        /// 验票
        /// </summary>
        private void picCheckTick_Click(object sender, EventArgs e)
        {
            
        }


        /// <summary>
        /// 关闭窗体释放资源
        /// </summary>
        private void FrmWork_FormClosed(object sender, FormClosedEventArgs e)
        {

        }


        /// <summary>
        /// 购物
        /// </summary>
        private void btnShoping_Click(object sender, EventArgs e)
        {
            
        }

        /// <summary>
        /// 结账
        /// </summary>
        private void btnCheckOut_Click(object sender, EventArgs e)
        {
            

        }

        /// <summary>
        /// 添加超时价格
        /// </summary>
        private void lblAddItem_Click(object sender, EventArgs e)
        {
           
        }

        /// <summary>
        /// 选择仅购物
        /// </summary>
        private void cbOnlyShop_CheckedChanged(object sender, EventArgs e)
        {
            
        }


        /// <summary>
        /// 显示菜单栏
        /// </summary>
        private void pictmenu_MouseClick(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Left)
            {
                morebtn.Show(pictmenu, new Point(e.X, e.Y - 10));
            }
        }

        /// <summary>
        ///菜单栏操作
        /// </summary>
        private void picmorebtn_UserClickEvent(object sender, PopEventArgs e)
        {
            
        }

        #region - 动态加载操作栏 -

        /// <summary>
        /// 创建包间操作条
        /// </summary>
        /// <param name="rm"></param>
        private void CreatTools(RoomControl rm)
        {
            //生成自动排列容器
            FlowLayoutPanel flpdow = new FlowLayoutPanel();
            flpdow.Height = 40;
            flpdow.Width = rm.Width + 50;

            //根据操作项，生成工具栏
            string[] t_Itme = {"上座", "维护", "预订列表"};     
            if (rm.Status == RoomStatus.Occupy)
                t_Itme[0] = "下座";
            if (rm.Status == RoomStatus.Repair)
                t_Itme[1] = "恢复";

            for (int i = 0; i < t_Itme.Length; i++)
            {
                Button btn = new Button();
                btn.Width = 82;
                btn.Height = 30;
                btn.Text = t_Itme[i];
                btn.Tag = rm;
                btn.FlatStyle = FlatStyle.Flat;
                btn.ForeColor = Color.FromArgb(67, 187, 188);
                btn.FlatAppearance.BorderSize = 1;
                btn.FlatAppearance.BorderColor = Color.Orange;
                btn.Font = new System.Drawing.Font(@"微软雅黑", 8);
                btn.Margin = new Padding(0, 0, 1, 0);
                btn.Click += btn_Click;
                btn.BackColor = Color.White;
                flpdow.Controls.Add(btn);
            }
            flpdow.Location = new Point(0, rm.Height - 32);
            rm.Controls.Add(flpdow);
            rm.Invalidate();
        }


       



        #endregion

       

        /// <summary>
        /// 鼠标进入单元格事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void dgvBill_CellMouseEnter(object sender, DataGridViewCellEventArgs e)
        {

        }

        /// <summary>
        /// 鼠标离开单元格,隐藏tips
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void dgvBill_CellMouseLeave(object sender, DataGridViewCellEventArgs e)
        {

        }


        /// <summary>
        /// 账单单元格点击事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void dgvBill_CellClick(object sender, DataGridViewCellEventArgs e)
        {

        }

    }
}
